# encoding=utf-8
"""
@author: xiao nian
@contact: xiaonian030@163.com
@time: 2021-12-12 15:30
"""


class Classification:
    # map
    classification_map = {
        "news_story": "故事",
        "news_culture": "文化",
        "news_entertainment": "娱乐",
        "news_sports": "体育",
        "news_finance": "财经",
        "news_house": "房产",
        "news_car": "汽车",
        "news_edu": "教育",
        "news_tech": "科技",
        "news_military": "军事",
        "news_travel": "旅游",
        "news_world": "国际",
        "stock": "股票",
        "news_agriculture": "农业",
        "news_game": "游戏"
    }
    # 分类字典
    index = 0
    classification_dict = dict()

    def set_item(self, item):
        if item != '' and item not in self.classification_dict.keys():
            self.index = self.index + 1
            self.classification_dict[item] = 'class_' + str(self.index)

    def get_item(self, item):
        return self.classification_dict[item]

    def get_all(self):
        return self.classification_dict
